package Guigu8.Super;

public class Studen extends Human{

	String major;
	int id;//学号
	
	public Studen()
	{
		
	}
	
	public Studen(String major)
	{
		//this.id = id;
		this.major = major;
	}
	
	public Studen(String name,int age,String major,int id)
	{
		super(name,age);
		this.major = major;
		this.id = id;
	}
	
	@Override//Overwrite
	public void eat() {
		System.out.println("学生就要多多吃有营养的食物");
	}
	
	public void sleep()
	{
		System.out.println("睡觉");
		eat();
		super.eat();//调的是父类中被重写的方法
	}
	
	public void show()
	{
		//System.out.println("name:"+name+",id:"+id);
		System.out.println("name:"+name+",age:"+super.age+",major:"+major+",学号："+id);
	}
}
